function [ac] = geo_inputs(xlsfile,xlssheet,ac)
%Components 
% wing
% htail
% vtail
% fus
% engine
% nac_pylon
% sys
% canard
% acft

% Data description:
% Basic Geometrical Data					
	% Reference Area .S
	% Aspect ratio .ar
	% Taper ratio .taper
	% Sweep quarter chord .sweep_1_4
	% Root chord .c_root
	% Tip chord .c_tip
	% Mean geometrical chord .mgc
	% Span .b
	% Root thickness .tc_root
	% Tip thickness .tc_tip
	% Thickness mgc .tc_mgc
%
% Other Geometrical Parameters					
	% Sweep max thickness .sweep_max_tc
	% Wetted area .s_wet
%

[num,txt, raw] = xlsread(xlsfile,xlssheet);

% Wing	
% Basic Geometrical Data					
ac.geo.wing.S            = cell2mat(raw(17,2));
ac.geo.wing.ar           = cell2mat(raw(4,2));
ac.geo.wing.taper        = cell2mat(raw(5,2));
ac.geo.wing.sweep_1_4    = cell2mat(raw(6,2));
ac.geo.wing.sweep_1_2    = cell2mat(raw(9,2));
ac.geo.wing.c_root       = cell2mat(raw(22,2));
ac.geo.wing.c_tip        = cell2mat(raw(23,2));
ac.geo.wing.mac          = cell2mat(raw(24,2));
ac.geo.wing.mgc          = ac.geo.wing.c_root/2*(1 + ac.geo.wing.taper);
ac.geo.wing.b            = cell2mat(raw(21,2));
ac.geo.wing.tc_root      = cell2mat(raw(13,2));
ac.geo.wing.tc_tip       = cell2mat(raw(14,2));
ac.geo.wing.t_max        = ac.geo.wing.tc_root*ac.geo.wing.c_root;
ac.geo.wing.tc_mgc       = (ac.geo.wing.tc_root + ac.geo.wing.tc_tip)/2;
% Other Geometrical Parameters					
ac.geo.wing.sweep_max_tc = ac.geo.wing.sweep_1_4;
ac.geo.wing.s_wet        = cell2mat(raw(18,2));
ac.geo.wing.h            = cell2mat(raw(54,2));


% Htail
% Basic Geometrical Data					
ac.geo.htail.S            = cell2mat(raw(17,3));
ac.geo.htail.ar           = cell2mat(raw(4,3));
ac.geo.htail.taper        = cell2mat(raw(5,3));
ac.geo.htail.sweep_1_4    = cell2mat(raw(6,3));
ac.geo.htail.sweep_1_2    = cell2mat(raw(9,3));
ac.geo.htail.c_root       = cell2mat(raw(22,3));
ac.geo.htail.c_tip        = cell2mat(raw(23,3));
ac.geo.htail.mac          = cell2mat(raw(24,3));
ac.geo.htail.mgc          = ac.geo.htail.c_root/2*(1 + ac.geo.htail.taper);
ac.geo.htail.b            = cell2mat(raw(21,3));
ac.geo.htail.tc_root      = cell2mat(raw(13,3));
ac.geo.htail.tc_tip       = cell2mat(raw(14,3));
ac.geo.htail.t_max        = ac.geo.htail.tc_root*ac.geo.htail.c_root;
ac.geo.htail.tc_mgc       = (ac.geo.htail.tc_root + ac.geo.htail.tc_tip)/2;
% Other Geometrical Parameters					
ac.geo.htail.sweep_max_tc = ac.geo.htail.sweep_1_4;
ac.geo.htail.s_wet        = cell2mat(raw(18,3));
ac.geo.htail.z_h          = cell2mat(raw(27,3));
ac.geo.htail.l_h          = cell2mat(raw(19,3));


% Vtail
% Basic Geometrical Data					
ac.geo.vtail.S            = cell2mat(raw(17,4));
ac.geo.vtail.ar           = cell2mat(raw(4,4));
ac.geo.vtail.taper        = cell2mat(raw(5,4));
ac.geo.vtail.sweep_1_4    = cell2mat(raw(6,4));
ac.geo.vtail.sweep_1_2    = cell2mat(raw(9,4));
ac.geo.vtail.c_root       = cell2mat(raw(22,4));
ac.geo.vtail.c_tip        = cell2mat(raw(23,4));
ac.geo.vtail.mac          = cell2mat(raw(24,4));
ac.geo.vtail.mgc          = ac.geo.vtail.c_root/2*(1 + ac.geo.vtail.taper);
ac.geo.vtail.b            = cell2mat(raw(21,4));
ac.geo.vtail.tc_root      = cell2mat(raw(13,4));
ac.geo.vtail.tc_tip       = cell2mat(raw(14,4));
ac.geo.vtail.t_max        = ac.geo.vtail.tc_root*ac.geo.vtail.c_root;
ac.geo.vtail.tc_mgc       = (ac.geo.vtail.tc_root + ac.geo.vtail.tc_tip)/2;
% Other Geometrical Parameters					
ac.geo.vtail.sweep_max_tc = ac.geo.vtail.sweep_1_4;
ac.geo.vtail.s_wet        = cell2mat(raw(18,4));


% Fuselage
% Basic Geometrical Data					
ac.geo.fus.l_pilot    = cell2mat(raw(30,2));
ac.geo.fus.l_pax      = cell2mat(raw(31,2));
ac.geo.fus.l_cone     = cell2mat(raw(32,2));
ac.geo.fus.lenght   = ac.geo.fus.l_pilot + ac.geo.fus.l_pax + ac.geo.fus.l_cone;
ac.geo.fus.diameter = cell2mat(raw(33,2));
% Other Geometrical Parameters					
ac.geo.fus.s_wet    = cell2mat(raw(36,2));
ac.geo.fus.eq_dia   = max(roots([2*pi 2*pi*ac.geo.fus.lenght -ac.geo.fus.s_wet]));


% Engine
ac.eng.type       = cell2mat(raw(39,2));
ac.eng.number     = cell2mat(raw(40,2));
ac.eng.th_to      = cell2mat(raw(47,2));
ac.eng.th_maxcont = cell2mat(raw(48,2));
ac.eng.th_climb   = cell2mat(raw(49,2));
ac.eng.th_cruise  = cell2mat(raw(50,2));
ac.eng.th_idle    = cell2mat(raw(51,2));

% Basic Geometrical Data					
ac.geo.eng.lenght   = cell2mat(raw(42,2));
ac.geo.eng.diameter = cell2mat(raw(41,2));
% Other Geometrical Parameters					
ac.geo.eng.s_wet    = cell2mat(raw(46,2));
ac.geo.eng.eq_dia   = cell2mat(raw(41,2));


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Weight calculation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% Configuration
ac.config.canard   = cell2mat(raw(57,2));
ac.config.wing     = cell2mat(raw(58,2));
if ac.config.wing == 1
    ac.config.posicaoAsa = 0;
    ac.config.fuselage = 0;
else
    ac.config.posicaoAsa = 1;
    ac.config.fuselage = 1;
end
ac.config.landGear = cell2mat(raw(59,2));
ac.config.tank     = cell2mat(raw(60,2));
ac.config.Kh       = cell2mat(raw(61,2));
ac.config.Kv       = cell2mat(raw(62,2));
ac.config.Kf       = cell2mat(raw(63,2));
ac.config.Trev     = cell2mat(raw(64,2));
ac.config.fs       = cell2mat(raw(65,2));
ac.config.fc       = cell2mat(raw(66,2));
ac.config.ox       = cell2mat(raw(67,2));

% Performance
% weight.landing  = cell2mat(raw(70,2));
% weight.fuel     = cell2mat(raw(71,2));
ac.perform.max_speed_z = cell2mat(raw(72,2));
ac.eng.p_to        = cell2mat(raw(73,2));
ac.eng.t_to        = cell2mat(raw(74,2));


% Fuselage
ac.geo.fus.s_ff    = cell2mat(raw(77,2));
ac.geo.fus.width   = cell2mat(raw(78,2));
ac.geo.fus.height  = cell2mat(raw(79,2));
ac.geo.fus.l_fn    = cell2mat(raw(80,2));
ac.geo.fus.perimeter = cell2mat(raw(81,2));

% Interior
ac.weight.payload  = cell2mat(raw(84,2));
ac.weight.crew     = cell2mat(raw(85,2));
ac.fus.v_paxCargo  = cell2mat(raw(86,2));
ac.config.n_pax    = cell2mat(raw(87,2));
ac.config.n_row    = cell2mat(raw(88,2));

% Loads
ac.config.load.ult     = cell2mat(raw(91,2));
ac.config.load.ult_l   = cell2mat(raw(92,2));
ac.config.load.dive_speed = cell2mat(raw(93,2));
ac.config.load.dive_mach  = cell2mat(raw(94,2));

% Engine
ac.eng.weight  = cell2mat(raw(97,2));
ac.eng.bypass  = cell2mat(raw(98,2));

% Propeller
ac.eng.prop_Np  = cell2mat(raw(101,2));
ac.eng.prop_Nbl = cell2mat(raw(102,2));
ac.eng.prop_Dp  = cell2mat(raw(103,2));

% Stability landing gear
ac.control.l_sm = cell2mat(raw(106,2));
ac.control.l_sn = cell2mat(raw(107,2));

% Systems
ac.weight.tfo  = cell2mat(raw(110,2));
ac.sys.int     = cell2mat(raw(111,2));
ac.sys.n_tank  = cell2mat(raw(112,2));

